home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / newmarch.zip / SCROLLED < prev   
Text File  |  1992-09-08  |  2KB  |  75 lines

  1. /* Author:   $Author: jan $
  2.  * File:     $Source: /usr/usrs/jan/desktop/X_Book.boo/programs/RCS/scrolled-text.c,v $
  3.  * Date:     $Date: 1992/09/09 00:10:08 $
  4.  * Revision: $Revision: 1.1 $
  5.  */
  6.  
  7. #include "copyright.h"
  8.  
  9. #include <stdio.h> 
  10.  
  11. #include <Xm/Text.h> 
  12. #include <Xm/ScrolledW.h> 
  13.  
  14. /*------------------------------------------------------------- 
  15. **     Forward Declarations 
  16. */ 
  17.  
  18. void main ();            /*  main logic for application    */ 
  19. void CreateApplication ();    /*  create main window        */ 
  20.  
  21. /*------------------------------------------------------------- 
  22. **    Global Variables 
  23. */ 
  24.  
  25. #define MAX_ARGS 20 
  26. #define Class_name "ScrolledText" 
  27.  
  28. Display *display;    /* the display device                */    
  29. int     screen;      /* the screen on the display         */    
  30. Window  scrolledtext;/* the scrolled text widget          */
  31.  
  32.     
  33. /*------------------------------------------------------------- 
  34. **    main        - main logic for application 
  35. */ 
  36. void main (argc,argv)  
  37.     unsigned int    argc; 
  38.     char         **argv; 
  39.     Widget        app_shell;    /*  ApplicationShell    */ 
  40.  
  41.      /*    Initialize toolkit, open the display and create the toplevel widget. */ 
  42.     app_shell = XtInitialize(argv[0], /* application name */    
  43.                Class_name,     /* class name */    
  44.                NULL,         /* options */    
  45.                0,        /* number of options */    
  46.                &argc, argv);    
  47.   
  48.     /* set up all the sub-widgets */ 
  49.     CreateApplication(app_shell);
  50.     XtRealizeWidget (app_shell); 
  51.  
  52.     /*    Get and dispatch events. 
  53.     */ 
  54.     XtMainLoop (); 
  55.  
  56. /*------------------------------------------------------------- 
  57. **     CreateApplication    - create main window 
  58. */ 
  59. void CreateApplication (parent)  
  60. Widget        parent;        /*  parent widget    */ 
  61.  
  62.      Arg        args[MAX_ARGS];    /*  arg list        */ 
  63.      register int    n;        /*  arg count        */ 
  64.  
  65.      n = 0; 
  66.      XtSetArg (args[n], XmNwidth, 200); n++;
  67.      XtSetArg (args[n], XmNheight, 100); n++;
  68.      XtSetArg (args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++;
  69.      scrolledtext = XmCreateScrolledText (parent, "scrolledText", args, n);    
  70.      XtManageChild (scrolledtext);     
  71.